/*
 * input_file.cpp
 *
 *  Created on: May 12, 2010
 *      Author: snirgaz
 */

#include "InputFile.h"

InputFile::InputFile(string fileName) :
		fileName_(fileName) {
}
void InputFile::readFile() {
	YAML::Node simData;
	try {
		YAML::Node simData = YAML::LoadFile(fileName_);

	} catch (YAML::Exception &result) {
		cout << "Error description: " << result.what() << "\n";
		exit(1);
	}
	YamlReader yr(simData);
	try {
		// Num of Particles
		qmcParameters_.NumP.setVal(yr.read<int>("N"));
		// Num Of Time Slices
		qmcParameters_.M.setVal(yr.read<int>("M"));
		// To init ?
		qmcParameters_.init.setVal(yr.read<bool>( "INIT"));
	} catch (KeyErrorExceptions & e) {
		cout << e.what() << endl;
	}
}

QmcParameters& InputFile::getQmcParams() {
	return qmcParameters_;
}
